package net.form.processing;

import java.util.List;

import net.model.RasgoClase;

public class KMeansOfObjectArea extends KMeansOfObject {

	public KMeansOfObjectArea(HSVRangeBackground rangeFondo,
			List<ObjetoClasificadorKmeans> objetos, int heft, List<RasgoClase> rasgos) {
		super(rangeFondo, objetos, heft,rasgos);
	}

//	@Override
//	public double getValue(ObjetoClasificadorKmeans obj) {
//		
//		try {
//				RasgoObjeto rasgoObjeto = er.calcularValor(obj.getObject());
//				return rasgoObjeto.getValor();
//		} catch (Exception e) {
//			e.printStackTrace();
//		}
//		return obj.getArea();
//	}

	@Override
	public Cluster initializeCluster(int id, int heft, double valor) {
		return new ClusterArea(id, heft, valor);
	}

	public Cluster[] createClusters( int k) {
		// Here the clusters are taken with specific steps,
		// so the result looks always same with same image.
		// You can randomize the cluster centers, if you like.
		Cluster[] result = new Cluster[6];
		//Valores fijo y por defecto por si no se encuentra en la BD.
		result[0] = initializeCluster(0, this.heft, 764.382430462656);
		result[1] = initializeCluster(1, this.heft, 324.82047228464444);
		result[2] = initializeCluster(2, this.heft, 74.02676509249493);
		result[3] = initializeCluster(3, this.heft, 123.49010358611655);
		result[4] = initializeCluster(4, this.heft, 101.39247891823317);
		result[5] = initializeCluster(5, this.heft, 0);
		return completeClusters(result);
	}
		
}